home *** CD-ROM | disk | FTP | other *** search
/ Top 200 Programs / Top 200 Programs.iso / Bob8 / THOMPSON / LIBERTY / PRODUCT / TUTORIAL.EXE / WK4PROG7.BAS < prev    next >
BASIC Source File  |  1996-03-05  |  1KB  |  45 lines

  1.  
  2.     'WK4PROG7.BAS - (WK4PROG6.BAS modified)
  3.     'open a window with a button, a textbox, and a statictext
  4.     'show how trapclose works
  5.     'the window is sized at 300 by 100 at position 200, 150
  6.  
  7.     nomainwin  'do not open a main window
  8.  
  9.     WindowWidth = 300
  10.     WindowHeight = 100
  11.     UpperLeftX = 200
  12.     UpperLeftY = 150
  13.     button #myFirst.ok, "OK!", [okClicked], UL, 220, 35
  14.     textbox #myFirst.field, 10, 35, 200, 25
  15.     statictext #myFirst.label, "Type some text here.", 10, 10, 150, 25
  16.     open "myname's first window!" for window as #myFirst
  17.  
  18.     'send the trapclose command
  19.     print #myFirst, "trapclose [quit]"
  20.  
  21. [waitHere]  'now stop and wait
  22.     input aVar$
  23.     goto [quit]
  24.  
  25. [okClicked]  'OK! was clicked.  Get the contents of the entry field
  26.  
  27.     'print a command to the textbox
  28.     print #myFirst.field, "!contents?"
  29.     'now get the contents from the textbox
  30.     input #myFirst.field, aString$
  31.  
  32.     'now pop up a notice saying what was in the textbox
  33.     notice aString$
  34.  
  35. [quit]
  36.     'ask if the user wants to quit
  37.     confirm "Really Quit?"; answer$
  38.     if answer$ <> "yes" then [waitHere] 'abort quitting
  39.  
  40.     'now close the window
  41.     close #myFirst
  42.  
  43.     end
  44.  
  45.